package com.csun.cmny.provider.service.impl;

import com.csun.cmny.core.support.BaseService;
import com.csun.cmny.provider.dao.DmcCsunSleepCollectionMapper;
import com.csun.cmny.provider.model.domain.DmcCsunSleepCollection;
import com.csun.cmny.provider.model.dto.csunsleep.CollectionQueryDto;
import com.csun.cmny.provider.model.vo.csunsleep.CollectionVo;
import com.csun.cmny.provider.service.DmcCsunSleepCollectionService;
import com.github.pagehelper.PageHelper;
import com.xiaoleilu.hutool.db.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2020-06-08 14:22
 * @Description:
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DmcCsunSleepCollectionServiceImpl extends BaseService<DmcCsunSleepCollection> implements DmcCsunSleepCollectionService {

    @Resource
    private DmcCsunSleepCollectionMapper dmcCsunSleepCollectionMapper;

    /**
     * 查询床垫采集数据列表 - 分页
     *
     * @param collectionQueryDto the collection query dto
     *
     * @return the list.
     */
    @Override
    public List<CollectionVo> queryCollectionListWithPage(CollectionQueryDto collectionQueryDto) {

        PageHelper.startPage(collectionQueryDto.getPageNum(), collectionQueryDto.getPageSize());

        return dmcCsunSleepCollectionMapper.queryCollectionListWithPage(collectionQueryDto);
    }
}
